Lua Scripting


API Definition Setup

To get started with Lua scripting in Mupen64, you should set up your project to use the API definitions.

You can find the API definitions as api.lua in the repack.

  1. Create a ./lib directory at the root of your project
  2. Copy api.lua into ./lib
  3. Add lib to workspace.library in your .luarc config at the root of your project

Most IDEs should now automatically recognize the API definitions and provide code completion and type checking.

It's not necessary to require or dofile the API definitions in your scripts; Mupen has its own internal copy that's automatically loaded.

Make sure to update the api.lua file in your ./lib directory whenever you update Mupen64.


Mupen64 Logo

Mupen64 Organization

The Mupen64 Organization is a shared-ownership organization maintained by developers around the world.
Feel free to contribute!

© 2026 Mupen64 Organization

Licensed under GNU GPL v2 License